//
//  YGWeightManagerView.m
//  yuanshangyiliao
//
//  Created by icholab on 2021/3/22.
//

#import "YGWeightManagerView.h"

@interface YGWeightManagerView ()

@property (nonatomic, strong) UILabel *weightTittle;
@property (nonatomic, strong) UIButton *miniBtn;
@property (nonatomic, strong) UIButton *weightBtn;



@end
@implementation YGWeightManagerView

- (instancetype)initWithFrame:(CGRect)frame
{
    self = [super initWithFrame:frame];
    if (self) {
        [self initView];
        [self initContraints];
    }
    return self;
}

- (void)initView{
    
    [self addSubview:self.weightTittle];
    [self addSubview:self.miniBtn];
    [self addSubview:self.weightBtn];
}


- (void)initContraints{
    
    [self.weightTittle mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.mas_equalTo(self.mas_top).offset(17);
        make.left.mas_equalTo(self.mas_left).offset(10);
        make.width.mas_equalTo(100);
        make.height.mas_equalTo(20);
    }];
    
    [self.miniBtn mas_makeConstraints:^(MASConstraintMaker *make) {
        make.centerY.mas_equalTo(self.weightTittle.mas_centerY);
            make.right.mas_equalTo(self.mas_right).offset(-10);
            make.width.mas_equalTo(7.5);
            make.height.mas_equalTo(12.5);
            
    }];
    
    [self.weightBtn mas_makeConstraints:^(MASConstraintMaker *make) {
            make.top.mas_equalTo(self.weightTittle.mas_bottom).offset(5);
            make.left.mas_equalTo(self.mas_left);
            make.right.mas_equalTo(self.mas_right);
            make.height.mas_equalTo(100);
            
    }];
}

-(void)clickAction{
    
}

#pragma setter

- (UILabel *)weightTittle{
    if (!_weightTittle) {
        _weightTittle = [[UILabel alloc] init];
        _weightTittle.text=@"减重管理";
        _weightTittle.textColor = UIColorFromRGB(0x37C8D7);
        _weightTittle.font=[UIFont fontWithName:@"Helvetica-Bold" size:17];
    }
    return _weightTittle;
}

- (UIButton *)miniBtn{
    if (!_miniBtn) {
        _miniBtn = [[UIButton alloc] init];
        [_miniBtn setBackgroundImage:[UIImage imageNamed:@"weight_minibtn_icon"] forState:UIControlStateNormal];
        [_miniBtn addTarget:self action:@selector(clickAction) forControlEvents:UIControlEventTouchUpInside];
        
    }
    return _miniBtn;
}

- (UIButton *)weightBtn{
    if (!_weightBtn) {
        _weightBtn= [[UIButton alloc]init];
        [_weightBtn setBackgroundImage:[UIImage imageNamed:@"weight_banner_icon"] forState:UIControlStateNormal];
        [_weightBtn addTarget:self action:@selector(clickAction) forControlEvents:UIControlEventTouchUpInside];
    }
    return _weightBtn;
}
/*
// Only override drawRect: if you perform custom drawing.
// An empty implementation adversely affects performance during animation.
- (void)drawRect:(CGRect)rect {
    // Drawing code
}
*/

@end
